package com.zsgl.dao.impl;

import java.io.Serializable;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.zsgl.dao.HotelDAO;
import com.zsgl.domain.Hotel;

public class HotelDAOImpl implements HotelDAO {

	@PersistenceContext
	EntityManager entityManager;
	
	public void save(Hotel hotel) {
		entityManager.persist(hotel);
	}

	public void delete(Hotel hotel) {
		entityManager.remove(hotel);
	}

	public void update(Hotel hotel) {
		entityManager.merge(hotel);
	}

	public Hotel find(Serializable id) {
		return entityManager.find(Hotel.class, id);
	}

	public void flush() {
		entityManager.flush();
	}

	
}
